package lew.bing.exp.commons;

import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;

/**
 * Created by 刘国兵 on 2018/8/6.
 */
public class Test1 {

    public static void main(String[] args) throws ClassNotFoundException, IntrospectionException {
        Class<?> cl = Class.forName("lew.bing.exp.commons.Abc");
        // 在bean上进行内省
        BeanInfo beaninfo = Introspector.getBeanInfo(cl, Object.class);
        PropertyDescriptor[] pro = beaninfo.getPropertyDescriptors();
        if (pro != null) {
            for (PropertyDescriptor pd:
                 pro) {
                System.out.println(pd.getName());
            }
        }
    }

}
